﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebmasterTool/Admin.Master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="Framework.WebmasterTool.Logs.Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        $(document).ready(function () {
            $("#chkAll").live("change", function () {
                if ($(this).is(":checked")) {
                    $(".checkbox").attr("checked", "checked");
                }
                else {
                    $(".checkbox").removeAttr("checked");
                }
            });
            $(".checkbox").live("click", function () {
                var allCheck = true;
                $(".checkbox").each(function () {
                    if (!$(this).is(":checked")) {
                        allCheck = false;
                        return;
                    }
                });
                if (allCheck == true) {
                    $("#chkAll").attr("checked", "checked");
                }
                else {
                    $("#chkAll").removeAttr("checked");
                }
            });
            $("#<%= btnDelete.ClientID %>").live("click", function () {
                var callFrom = $(this);
                jConfirm('Chắc chắn xoá?', 'Digisky Confirm Dialog',
                function (r) {
                    if (r) {
                        __doPostBack(callFrom.attr('name').replace(/_/g, '$'), '');
                    }
                });
                return false;
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ctlCaption" runat="server">
    Nhật ký hệ thống
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="PageContent" runat="server">
    <asp:Label ID="lblPermissionMessage" runat="server" Font-Bold="true" ForeColor="Red"
        Text="Tài khoản không có quyền truy cập vào trang này" Visible="false"></asp:Label>
    <asp:Panel ID="Panel1" runat="server" Visible="true">
        <table align="center" width="785" cellpadding="" cellspacing="0" border="0">
            <tr>
                <td>
                    <table width="610" align="center" cellpadding="5" cellspacing="0" border="0">
                        <tr>
                            <td align="left">
                                Ngày thao tác Từ:
                                <asp:TextBox ID="txtFomDate" runat="server" Width="150"></asp:TextBox>
                                <AjaxControlToolkit:CalendarExtender ID="CalendarExtender1" Format="dd/MM/yyyy hh:mm:ss tt"
                                    runat="server" TargetControlID="txtFomDate">
                                </AjaxControlToolkit:CalendarExtender>
                                <AjaxControlToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MaskType="DateTime"
                                    ClearMaskOnLostFocus="true" TargetControlID="txtFomDate" AcceptAMPM="true" Mask="99/99/9999 99:99:99"
                                    AutoComplete="false" InputDirection="LeftToRight" ErrorTooltipEnabled="true"
                                    MessageValidatorTip="true">
                                </AjaxControlToolkit:MaskedEditExtender>
                                <AjaxControlToolkit:MaskedEditValidator ID="MaskedEditValidator1" runat="server"
                                    ValidationGroup="LogSystem" ControlToValidate="txtFomDate" ControlExtender="MaskedEditExtender1"
                                    EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" InvalidValueMessage="Sai định dạng ngày tháng năm giờ phút giây"
                                    IsValidEmpty="true"> 
                                </AjaxControlToolkit:MaskedEditValidator>
                                đến:
                                <asp:TextBox ID="txtToDate" runat="server" Width="150"></asp:TextBox>
                                <AjaxControlToolkit:CalendarExtender ID="CalendarExtender2" Format="dd/MM/yyyy hh:mm:ss tt"
                                    runat="server" TargetControlID="txtToDate">
                                </AjaxControlToolkit:CalendarExtender>
                                <AjaxControlToolkit:MaskedEditExtender ID="MaskedEditExtender2" runat="server" MaskType="DateTime"
                                    ClearMaskOnLostFocus="true" TargetControlID="txtToDate" AcceptAMPM="true" Mask="99/99/9999 99:99:99"
                                    AutoComplete="false" InputDirection="LeftToRight" ErrorTooltipEnabled="true"
                                    MessageValidatorTip="true">
                                </AjaxControlToolkit:MaskedEditExtender>
                                <AjaxControlToolkit:MaskedEditValidator ID="MaskedEditValidator2" runat="server"
                                    ValidationGroup="LogSystem" ControlToValidate="txtToDate" ControlExtender="MaskedEditExtender2"
                                    EmptyValueBlurredText="*" InvalidValueBlurredMessage="*" InvalidValueMessage="Sai định dạng ngày tháng năm giờ phút giây"
                                    IsValidEmpty="true"> 
                                </AjaxControlToolkit:MaskedEditValidator>
                            </td>
                            <td rowspan="2">
                                <asp:Button runat="server" ID="btnSearch" Text="Tìm kiếm" ValidationGroup="LogSystem"
                                    OnClick="btnSearch_Click" />
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Từ khoá:
                                <asp:TextBox runat="server" ID="txtKeyword" Width="201"></asp:TextBox>
                                Người thao tác:
                                <asp:DropDownList runat="server" ID="ddlUsers" Width="150px" AppendDataBoundItems="true">
                                    <asp:ListItem Text="[Tất cả]" Value="0"></asp:ListItem>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td align="center" style="padding-top: 10px;">
                    <asp:GridView runat="server" Width="785" ID="grvLogs" CssClass="grid" AutoGenerateColumns="false"
                        AllowPaging="true" PageSize="10" AllowSorting="true" ToolTip="all" OnSorting="grvLogs_Sorting"
                        OnDataBinding="grvLogs_DataBinding" OnPageIndexChanging="grvLogs_PageIndexChanging">
                        <Columns>
                            <asp:TemplateField ItemStyle-HorizontalAlign="Center" ItemStyle-Width="20px" HeaderStyle-Width="20px">
                                <HeaderTemplate>
                                    <input id="chkAll" type="checkbox" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <input id="chkSelect" runat="server" class="checkbox" type="checkbox" title='<%# Eval("LogID") %>' />
                                </ItemTemplate>
                                <HeaderStyle Width="20px" />
                                <ItemStyle HorizontalAlign="Center" Width="20px" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Tiêu đề" SortExpression="Title" HeaderStyle-HorizontalAlign="Left"
                                ItemStyle-HorizontalAlign="left">
                                <ItemTemplate>
                                    <asp:HyperLink ID="hplArticleEdit" runat="server" NavigateUrl='<%# "LogDetails.aspx?LogID=" + Eval("LogID") %>'
                                        Text='<%# Eval("Title") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Địa chỉ IP" HeaderStyle-HorizontalAlign="Left" ItemStyle-HorizontalAlign="left"
                                HeaderStyle-Width="150" ItemStyle-Width="150">
                                <ItemTemplate>
                                    <%# Eval("IpAdress") %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Ngày tạo" SortExpression="ActionedDate" HeaderStyle-Width="90"
                                ItemStyle-Width="90" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="center">
                                <ItemTemplate>
                                    <asp:HiddenField ID="hdfAddedDate" runat="server" Value='<%# Eval("ActionedDate") %>' />
                                    <%# String.Format("{0:dd/MM/yyyy HH:mm:ss tt}", (DateTime)(Eval("ActionedDate")))%>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Người thực hiện" SortExpression="ActionBy" HeaderStyle-Width="150"
                                ItemStyle-Width="150" HeaderStyle-HorizontalAlign="center" ItemStyle-HorizontalAlign="center">
                                <ItemTemplate>
                                    <%# Eval("ActionBy")%>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <EmptyDataTemplate>
                            <table align="center" width="300" border="0">
                                <tr>
                                    <td height="50" align="center">
                                        <div style="text-align: center">
                                            Không có dữ liệu
                                        </div>
                                    </td>
                                </tr>
                            </table>
                        </EmptyDataTemplate>
                        <PagerSettings Mode="NumericFirstLast" />
                    </asp:GridView>
                </td>
            </tr>
            <tr>
                <td align="left">
                    <br />
                    <asp:Button runat="server" ID="btnDelete" Text="Xoá các log đã chọn" OnClick="btnDelete_Click" /><br />
                    <br />
                    <br />
                </td>
            </tr>
        </table>
    </asp:Panel>
</asp:Content>
